package com.fastloan.safe.mgt.sys.controller;

import com.fastloan.safe.mgt.sys.model.CmChinaCity;
import com.fastloan.safe.mgt.sys.service.CmChinaCityService;
import com.kawins.base.baseabs.BaseController;
import com.kawins.result.ResultTo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author rankai
 *         createTime 2017-11-2017/11/8 10:30
 */
@RestController
@RequestMapping("/api/cmChinaCity")
public class CmChinaCityController extends BaseController<CmChinaCity> {

    @Autowired
    private CmChinaCityService chinaCityService;

    @GetMapping
    public ResultTo select(@RequestParam(required = false) Integer pid) {
        return new ResultTo().setData(adaptService.select(new CmChinaCity().setPid(pid == null ? 0 : pid)));
    }
}
